/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bahrie.impl;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import com.bahrie.entity.Penjualan;
import com.bahrie.interfaces.InterPenjualan;

/**
 *
 * @author Saiful Bahri
 * blog    : http://bahrie27.wordpress.com/
 * twitter : @bahrie127
 */
@Repository
public class ImplPenjualan extends HibernateDaoSupport implements InterPenjualan{

    @Autowired
    public void setSuperSessionFactory(SessionFactory sessionFactory){
        super.setSessionFactory(sessionFactory);
    }

    public void insert(Penjualan o) throws DataAccessException {
       getHibernateTemplate().save(o);
    }

    public void update(Penjualan o) throws DataAccessException {
        getHibernateTemplate().saveOrUpdate(o);
    }

}
